package com.xy.annotaion.handler.kotlin.demo.demo1

import com.google.gson.Gson
import com.xy.annotaion.handler.aop.advisor.TestAdvisor
import com.xy.annotaion.handler.kotlin.p
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
import reactor.core.publisher.Mono
import javax.annotation.Resource

public open class A0 {

}

val a0 = Mono.just(123);

/**
 * not work
 */
@Resource
private lateinit var b0: TestAdvisor

/**
 * not work
 */
@GetMapping("/kotlin/hello0")
fun hello0() = "Hello 0 Kotlin"

@RestController
class B0 {
    /**
     * it works well
     */
    @GetMapping("/kotlin/hello0")
    fun hello0() = "Hello 0 Kotlin"

    /**
     *
     */
    @Resource
    private lateinit var testAdvisor: TestAdvisor

    @Resource
    private lateinit var gson: Gson;

    @GetMapping("/kotlin/testAdvisor")
    fun testAdvisor() = Mono.just(testAdvisor)


}

fun main() {
    p(a0)
    a0.subscribe {
        p(it)
    }

    p(Mono.empty<Any>())

}
